02. Big Picture and Intuition
Big Picture and Intuition
In this section, you'll learn to distinguish between sequential, concurrent, and parallel programs.
ND079 JPND C2 L05 A02 Big Picture And Intuition
Sequential vs Concurrent vs Parallel
The difference between these kinds of programs lies in how and when the program works on tasks. A task in this context is any unit of work, such as processing a user request.
- Sequential programs can only work on one task at a time.
- Concurrent programs can have multiple tasks in progress at the same time.
- Parallel programs can actively be working on multiple tasks at the same time.
Why Do We Use Concurrency and Parallelism?
- Allows programs to get more work done in the same amount of time.
- Divides a problem into smaller subproblems, and solves each subproblem in parallel.
QUIZ QUESTION::
Match each scenario with the kind of processing it best describes
ANSWER CHOICES:
Scenario |
Kind of Processing |
---|---|
You start the laundry machine. While it's running, you go fold some other clean clothes. |
|
You start the laundry machine, and then sit and wait for it to finish before starting the next load. |
|
You buy another laundry machine, and then you run two loads of laundry at the same time. |
SOLUTION:
Scenario |
Kind of Processing |
---|---|
You start the laundry machine, and then sit and wait for it to finish before starting the next load. |
|
You buy another laundry machine, and then you run two loads of laundry at the same time. |
|
You start the laundry machine. While it's running, you go fold some other clean clothes. |